<template  lang="pug">
view.page
	<!-- u-sticky -->
	navbar(@height="height" :type="type")
		view.flex.at.jt(slot="header" style="height:100%")
			view.w50.flex.at.jt() 特膳商城
	view(:style="{'background': 'url('+img+') 100% 100%','paddingTop':(h)+'px','background-size': '100% 100%'}" style="padding-bottom:0px")
		view.box.prl10
			u-search(
				placeholder="请输入"
				:showAction="false"
			)
		view.bg
			u-swiper(
				:list="list1"
				@change="change"
				@click="click"
			)
	view.p10.box
		view.bg.flex.cart
			view.w25.ct.box(v-for="item,index in datas" style="padding:10px 0" @click="goodslist")
				image(
					:src="'/static/t/'+(index+1)+'.png'",
					mode="widthFix",
					style="width:50px;"
				)
				view.f12.c6 {{item.name}}
	view.box
		view.title.mt10
			More(
				name="为你推荐"
				istrue="true"
			)
		goodslist
</template>

<script>
	import navbar from "@/components/navbar.vue"
	import goodslist from "@/components/goodslist.vue"
	import img1 from "@/static/my/bg.png"
	import More from "@/components/More.vue"
	export default {
		components:{
			navbar,
			goodslist,
			More
		},
		data() {
			return {
				h:0,
				type:1,
				img:img1,
				list1: [
					'https://cdn.uviewui.com/uview/swiper/swiper1.png',
					'https://cdn.uviewui.com/uview/swiper/swiper2.png',
					'https://cdn.uviewui.com/uview/swiper/swiper3.png',
				],
				datas:[
					{name:'妊娠高血糖'},
					{name:'睡眠障碍'},
					{name:'高血压'},
					{name:'商品分类'},
					{name:'高血压'},
					{name:'妊娠高血糖'},
					{name:'睡眠障碍'},
					{name:'商品分类'}
				]
			}
		},
		onPageScroll(e) {
			// console.log(e)
			e.scrollTop>=10?this.type='#ffffff':this.type=1
		},
		methods: {
			height(e){
				this.h=e
			},
			goodslist(e){
				uni.navigateTo({
					url:'./goodslist'
				})
			}
		}
	}
</script>

<style>
page{
	background: #F9F9F9;
}
</style>
